<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<body>
用户名：<input type="text" value="admin" name="username"/>
密码：<input type="password" value="admin" name="password"/>
<button onclick="submit()">提交</button>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/1.7.8/axios.js"></script>
<script>
    function submit() {
        const formData = new FormData()
        formData.append('username', document.getElementsByName('username')[0].value)
        formData.append('password', document.getElementsByName('password')[0].value)
        axios
            .post('http://localhost:8080/customLogin', formData)
            .then(res => {
                console.log(res)
                alert('跳转登录成功页')
            })
            .catch(error => {
                console.log(error)
                alert('提示登录失败')
            })
    }
</script>
</html>